package com.erp.erp_dao.ShipmentPlan;

import com.erp.erp_entitys.ShipmentPlan.ShipmentPlan;
import com.erp.erp_entitys.ShipmentPlan.ShipmentPlanStatistics1Req;
import com.erp.erp_entitys.ShipmentPlan.ShipmentPlanStatistics1Res;
import com.erp.erp_entitys.ShipmentPlan.ShipmentPlanVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface IShipmentPlanDAO {
    int deleteByPrimaryKey(Integer id);

    int insert(ShipmentPlan record);

    int insertSelective(ShipmentPlan record);

    ShipmentPlan selectByPrimaryKey(Integer id);
    ShipmentPlan selectInfoByCode(String shipmentNo);
    int updateByPrimaryKeySelective(ShipmentPlan record);

    int updateByPrimaryKey(ShipmentPlan record);

    List<ShipmentPlan> selectShipmentPlanList(ShipmentPlanVo vo);

    List<ShipmentPlan> selectByIdList(List<Integer> list);

    int updateBoxStatusByKey(ShipmentPlanVo vo);

    ShipmentPlan selectInfoById(Integer id);

    List<ShipmentPlan> isExist(String oddNumber);
    int getCount(String oddNumber);



    //******************  统计  ************************************

    /**
     * 出运结汇一览总表 统计
     * @param req
     * @return
     */
    public List<ShipmentPlanStatistics1Res> shipmentPlanStatistics1(ShipmentPlanStatistics1Req req);

    /**
     * 根据 外销合同号 产品编码 查询该产品的剩余数量
     * @param shipmentPlanProductId 出运计划产品的id
     * @param exportCode 外销合同号
     * @param productCode 产品编码
     * @return 剩余数量
     */
    Integer exportSurplusAmount(@Param("shipmentPlanProductId")Integer shipmentPlanProductId,
                                @Param("id")Integer id,
                                @Param("exportCode")String exportCode,
                                @Param("productCode")String productCode,
                                @Param("specNo")String specNo);
    /**
     * 根据 外销合同号 产品编码 查询该产品的剩余数量
     * @param shipmentPlanProductId 出运计划产品的id
     * @param exportCode 外销合同号
     * @param productCode 产品编码
     * @return 剩余数量
     */
    Integer taskSurplusAmount(@Param("shipmentPlanProductId")Integer shipmentPlanProductId,
                              @Param("exportCode")String exportCode,
                              @Param("productCode")String productCode,
                              @Param("specNo")String specNo);

}